<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .father {
            box-sizing: border-box;
            position: relative;
            width: 200px;
            height: 200px;
            background-color: pink;
            margin: 100px;
            padding: 10px;
        }
        .son{
            width: 100px;
            height: 100px;
            margin-left: 45px;
            border-top: 10px solid #ccc;
            
            background-color: purple;
        }
    </style>
</head>

<body>
    <div class="father">
        <div class="son" ></div>
    </div>
    <script>
        var father = document.querySelector('.father');
        var son=document.querySelector('.son');
        console.log(father.offsetTop);
        console.log(father.offsetLeft);
        console.log(son.offsetLeft);
        console.log(father.offsetWidth);
        console.log(son.offsetParent.parentNode);
        console.log(son.hasAttribute('style.width'));
        console.log(son.clientTop);
        
        
    </script>
</body>

</html>